function Tab(){
    this.li = document.querySelectorAll(".cont li");
    this.div = document.querySelectorAll("img");
    
}
Tab.prototype.bianhao = function(){
    for(var i=0;i<this.li.length;i++){
        this.li[i].hao = i;
    }
}
Tab.prototype.bangdingshijian = function(){
    const that = this;
    for(var i=0;i<this.li.length;i++){
        this.li[i].onclick = function(){
            for(var i=0;i<that.li.length;i++){
                that.li[i].className = ""
            }
            this.className = "active";
            that.xianshineirong(this.hao)
        }
    }
}
Tab.prototype.xianshineirong = function(index){
    for(var i=0;i<this.div.length;i++){
        this.div[i].style.display = "none";
    }
    this.div[index].style.display = "block";
}



var t = new Tab();
t.bianhao();
t.bangdingshijian();